﻿CREATE PROCEDURE [dbo].[proc_Orders_Reason_Create]
	(
		@OId uniqueidentifier,
		@Sales nvarchar(50),
		@TypeId int,
		@Type nvarchar(50),
		@Description nvarchar(1000),
		@CreateUser nvarchar(50),
		@CreateDate datetime
	)
AS
BEGIN
	Insert Into Orders_Reason(OId,Sales,TypeId,Type,Description,CreateUser,CreateDate) Values(@OId,@Sales,@TypeId,@Type,@Description,@CreateUser,@CreateDate)--插入拒绝成单信息
	if(@TypeId=1)
		begin
			Delete From Orders Where OId=@OId
		end
	else
		begin
			Update Orders Set IsReason=1 Where OId=@OId
		end
END
	RETURN
